package com.example.leonard.core.mq.provider;

import com.example.leonard.core.mq.mqconfig.MQConstants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TopicProvider {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMessage() {
        String context = "send message";
        rabbitTemplate.convertAndSend(MQConstants.TOPICEXCHANGE, MQConstants.TOPIC_ROUTING_KEYS, context);
    }

}
